Optimal. Leaf size=51 \[ -\frac {a \sin (c+d x)}{d}+\frac {a \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \sin (c+d x) \cos (c+d x)}{2 d}+\frac {a x}{2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {3872, 2838, 2592, 321, 206, 2635, 8} \[ -\frac {a \sin (c+d x)}{d}+\frac {a \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \sin (c+d x) \cos (c+d x)}{2 d}+\frac {a x}{2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 206
Rule 321
Rule 2592
Rule 2635
Rule 2838
Rule 3872
Rubi steps
\begin {align*} \int (a+a \sec (c+d x)) \sin ^2(c+d x) \, dx &=-\int (-a-a \cos (c+d x)) \sin (c+d x) \tan (c+d x) \, dx\\ &=a \int \sin ^2(c+d x) \, dx+a \int \sin (c+d x) \tan (c+d x) \, dx\\ &=-\frac {a \cos (c+d x) \sin (c+d x)}{2 d}+\frac {1}{2} a \int 1 \, dx+\frac {a \operatorname {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {a x}{2}-\frac {a \sin (c+d x)}{d}-\frac {a \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {a x}{2}+\frac {a \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \sin (c+d x)}{d}-\frac {a \cos (c+d x) \sin (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.06, size = 54, normalized size = 1.06 \[ \frac {a (c+d x)}{2 d}-\frac {a \sin (c+d x)}{d}-\frac {a \sin (2 (c+d x))}{4 d}+\frac {a \tanh ^{-1}(\sin (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.65, size = 55, normalized size = 1.08 \[ \frac {a d x + a \log \left (\sin \left (d x + c\right ) + 1\right ) - a \log \left (-\sin \left (d x + c\right ) + 1\right ) - {\left (a \cos \left (d x + c\right ) + 2 \, a\right )} \sin \left (d x + c\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.27, size = 88, normalized size = 1.73 \[ \frac {{\left (d x + c\right )} a + 2 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 2 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.28, size = 62, normalized size = 1.22 \[ -\frac {a \cos \left (d x +c \right ) \sin \left (d x +c \right )}{2 d}+\frac {a x}{2}+\frac {c a}{2 d}-\frac {a \sin \left (d x +c \right )}{d}+\frac {a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 59, normalized size = 1.16 \[ \frac {{\left (2 \, d x + 2 \, c - \sin \left (2 \, d x + 2 \, c\right )\right )} a + 2 \, a {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )}}{4 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.07, size = 80, normalized size = 1.57 \[ \frac {a\,x}{2}-\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+3\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {2\,a\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ a \left (\int \sin ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \sin ^{2}{\left (c + d x \right )}\, dx\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________